package com.d0324;

public class String2 {
    public static void main(String[] args) {
//        String str = "hello";
//        String str2 = " hi.txt";
//        System.out.println(str.substring(2));
//        System.out.println(str.substring(1,4));
//        System.out.println(str.compareTo(str2));
//        System.out.println(str.startsWith("h"));
//        System.out.println(str2.endsWith("txt"));
//        System.out.println(str2.trim());

        String str3 = "jack,22,dalian";
        String[] arr = str3.split(",");
        for (int i = 0; i <arr.length; i++) {
            System.out.println(arr[i]);
        }

        String str4 = str3.replaceAll(",","-");
        System.out.println(str4);
    }

}
